package MapToSet;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class entrySetTest {
    public static void main(String[] args) {
        Map<String, String> map = new HashMap<String, String>();
        map.put("1", "one");
        map.put("2", "two");
        map.put("3", "three");
        Set<Entry<String, String>> set = map.entrySet();
        for (Iterator<Entry<String, String>> it = set.iterator(); it.hasNext(); ) {
            Entry<String, String> entry = it.next();
            System.out.println(entry.getKey() + "->" + entry.getValue());
        }
    }
}
